<?php
/**
 * Simple helper to retrieve the 'redir' $_GET parameter
 *
 * @category   PacePlux-Sales
 * @package    BIS_Controller_Helper
 */
class BIS_Controller_Helper_RedirectUrl extends Zend_Controller_Action_Helper_Abstract
{
    public function direct($withRedir=false)
    {
        $httpRequestObject = new Zend_Controller_Request_Http();
        
        $redir = $httpRequestObject->getParam('redir'); 

        if($redir !== null){
            $redir = ($withRedir === true) ? '?redir='.urlencode($redir) : $redir;
        }else{
            $redir = null;
        }
        return $redir;
    }
}